<template>
    <el-button :icon="iconName" type="text" @click="handlerClick">{{btnText}}</el-button>
</template>

<script>
    export default {
        name: "btn-collapse-basic",
        props:{
            btnText : {
                type:String,
                required:false,
                default:'高级查询'
            },
            isShow : {
                type:Boolean,
                required:true
            }
        },
        data(){
            return {
                iconName:"el-icon-caret-top"
            }
        },
        methods:{
            handlerClick(){
                this.$emit('update:isShow' , !this.isShow);
                if(this.isShow) {
                    this.iconName='el-icon-caret-top';
                } else {
                    this.iconName='el-icon-caret-bottom';
                }
            }
        }
    }
</script>

<style scoped>

</style>